/**
 * 广寒宫
 * 网址:www.guanghangong.xyz
 */
package com.moon.admin.sys.service;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moon.admin.sys.entity.SysUserRoleEntity;
import com.moon.admin.sys.mapper.SysUserRoleMapper;

/**
 * 用户与角色的关系
 * @author ninlong
 *
 */
@Service
public class SysUserRoleService extends ServiceImpl<SysUserRoleMapper, SysUserRoleEntity>{

	/**
	 * 该角色是否绑定用户
	 */
	public boolean hasUser(Integer roleId) {
		return this.count(Wrappers.<SysUserRoleEntity>lambdaQuery().eq(SysUserRoleEntity::getRoleId, roleId))>0;
	}
}
